library(vcd)
library(ggplot2)
pass <- read.csv("charity.csv")
plot(pass$POOR, pass$DONATION)
boxplot(pass$POOR)
mr <- glm(DONATION ~ TOTMONTHS+TIMELAG+GENDER+HOWNER+INCOME+WEALTH+HOMEVALUE+AVGINCOME+MEDINCOME+
            POOR+NORTH+SOUTH+MIDLANDS+AVGCOST+INCOME*AVGINCOME
        , data=pass, family=binomial, control = list(maxit = 50))

pre=mr$fitted.values
library(ROCR)
library(car)
pred <- prediction(pre,pass$DONATION)
performance(pred,'auc')@y.values  #AUC
perf <- performance(pred,'tpr','fpr')
plot(perf)
# mmps(mr,layout=c(3,4),key=FALSE)
aov <- aov(DONATION ~ TOTMONTHS+TIMELAG+GENDER+HOWNER+INCOME+WEALTH+HOMEVALUE+AVGINCOME+MEDINCOME+
             POOR+NORTH+SOUTH+MIDLANDS+AVGCOST+INCOME*AVGINCOME,data=pass)
